<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
	"http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<link type="image/x-icon" rel="icon" href="http://nodejs.org/favicon.ico">
		<title>Lucky Lot</title>
		<!--script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script-->
		<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.js"></script>
		<script type="text/javascript" src="./js/jsLoader.js"></script>
		<script type="text/javascript" src="./js/common.js"></script>
		<script type="text/javascript" src="./js/menu.js"></script>
		<script type="text/javascript" src="./js/ImgBox.js"></script>
		<script type="text/javascript" src="./js/HtmlBox.js"></script>
		<script type="text/javascript" src="./js/debug.js"></script>
		<script type="text/javascript" src="./js/traceMouse.js"></script>
		<link rel="alternate" type="application/rss+xml" title="node blog" href="http://feeds.feedburner.com/nodejs/123123123">
		<!--script src="http://vkontakte.ru/js/api/openapi.js" type="text/javascript"></script-->
		<script type="text/javascript" src="//vk.com/js/api/openapi.js?112"></script>
		<script>
			$(function() {
				var hash = window.location.hash;
				console.log("hash1: " + hash);
				if(hash && hash!=''){
					console.log("hash1: " +hash);
					console.log(hash);
					reloadContent(hash)
				} else {
					reloadContent("main");
				} 
				VK.Auth.getLoginStatus(authInfo);
				VK.UI.button('login_button');
				
				VK.init({
					apiId: 4162584, onlyWidgets: true
				});
				VK.Widgets.Like("vk_like", {type: "mini", height: 20, 
					pageTitle: 'Lucky Lot', 
					pageDescription: 'Дизайн-студия индивидуального пошива Lucky Lot, занимается изготовлением сценических, театральных, повседневных костюмов и их прокатом.',
					text: 'Дизайн-студия индивидуального пошива Lucky Lot, занимается изготовлением сценических, театральных, повседневных костюмов и их прокатом.'
				}, 2);
				query("login&action=is_login", function(data){
					if(data.result){
						console.log('login complete');
						$('.userName').css('display', 'block');
						var userNameTag = data.user_name + "(<a href='#' class='logOut'>logout</a>)"
						$('.userName').html(userNameTag);
						$('#login_button').css('display', 'none');
						$('.logOut').click(logOut);
						query("login&action=is_admin&uid=" + data.user_id, function(data){
							if(data.result){
								UserData.isAdmin = data.result;
								refreshContent();
							}
						});
					}
				});
				var unSelectableElName = '.header, .header_alt, .tab, th, img, h1';
				unselectElement(unSelectableElName);
				MENU.addTab('mainBtn', 'главная', function(){reloadContent('main')});
				MENU.addTab('btn', 'пошив на заказ', function(){reloadContent('custom_tailoring&description')});
				MENU.addToTab('btn', 'условия индивидуального пошива', function(){reloadContent('custom_tailoring&description')});
				MENU.addToTab('btn', 'галерея готовых работ', function(){reloadContent('custom_tailoring&items')});
				MENU.addTab('btnShowAllHires', 'прокат', function(){reloadContent('terms_of_rental&description=2')});
				MENU.addToTab('btnShowAllHires', 'условия проката', function(){reloadContent('terms_of_rental&description')});
				MENU.addToTab('btnShowAllHires', 'костюмы на прокат', function(){reloadContent('terms_of_rental&hire')});
				MENU.addTab('btnShowAllSells', 'продажа', function(){reloadContent('selling&description=2')});
				MENU.addToTab('btnShowAllSells', 'условия продажи', function(){reloadContent('selling&description=2')});
				MENU.addToTab('btnShowAllSells', 'костюмы на продажу', function(){reloadContent('selling&sell')});
				MENU.addTab('btnShowAllStock', 'акции', function(){reloadContent('stock')});
				MENU.addTab('btnShowAllNew', 'новости', function(){reloadContent('news')});
				MENU.addTab('btnShowContacts', 'контакты', function(){reloadContent('contacts')});
				MENU.init();
				initLapa();
				unselectElement('dot5');
				reposeHNTree();

				function reposeHNTree() {
					var rightXOffset = 45;
					var $scrollTop = parseInt($(window).scrollTop());
					var $windowH = parseInt($(window.top).height());
					var $windowW = parseInt($(window.top).width());
					var $dot5 = $('#dot5');
					$dot5.css({"top": ($scrollTop + $windowH - (256 + 10)) + 'px'});
					$dot5.css({"left": ($windowW - (256 + rightXOffset)) + 'px'});
				}

				$(window).scroll(function () {
					reposeHNTree();
				});
				$(window).resize(function(){
					reposeHNTree();
				})
			});
			
			function logOut() {
				$('.userName').css('display', 'none');
				$('#login_button').css('display', 'block');
				query("login&action=logout", function(data){
					if(data.result){
						UserData.isAdmin = false;
					}
				});
			}
			
			function authInfo(response) {
				if (response.session) {
					var user = response.session.user;
					var userName = user.first_name + " " + user.last_name;
					// console.log('user: '+response.session.mid);
					// console.log(response);
					UserData.uid = user.id;
					UserData.name = userName;
					query("login&action=login&uname="+ userName + "&uid=" + user.id, function(data){
						/*console.log(data);
						console.log(JSON.parse(data));
						console.log(typeof data);
						console.log(new String(data).valueOf() == new String('true').valueOf());*/
						if(typeof data == 'string'){
							data = JSON.parse(data);
						} 
						if(data.result) {
							console.log('login complete');
							$('.userName').css('display', 'block');
							var userNameTag = userName + "(<a href='#' class='logOut'>logout</a>)"
							$('.userName').html(userNameTag);
							$('#login_button').css('display', 'none');
							$('.logOut').click(logOut);
							query("login&action=is_admin&uid=" + user.id, function(data){
								if(typeof data == 'string'){
									data = JSON.parse(data);
								} 
								if(data.result){
									UserData.isAdmin = data.result;
									refreshContent();
								}
							});
						}
					});
				} else {
					console.log('not auth');
					$('.userName').css('display', 'none');
				}
			}
		</script>
		<link href="./css/mainPage.css" rel="stylesheet" media="all" type="text/css">
	</head>
	<body style="background-image: url(http://static.tumblr.com/f7aa8e97dda652b03c08e711cb0dbf1c/3qo3xdx/7rgmztzf6/tumblr_static_light_background_repeating.jpg)">
		<div id="dot5" style="pointer-events: none;-webkit-user-select: none;width:256px; height:256px; position:absolute; left:135px; top:14px; z-index:1;"><img style="background:url(http://www.ivgeo.net/wp-content/uploads/2009/12/christmas_tree.png); _background: none; _filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='http://cdn.swcdn.net/creative/v11.1/images/icons/icon-prod-hl-automatic-configuration-backup.png');margin-left:40px;" src="http://yorkmylove.ru/img/blank.gif" height="256" width="256"></div>
		<div id="dot0" style="width:40px; height:40px; position:absolute; left:135px; top:14px; z-index:100500; visibility:hidden;"><img src="http://www.mymerrychristmas.com/forum/images/styles/merry/statusicon/forum_old.gif" height="1" width="1"></div>
		<div id="dot1" style="width:40px; height:40px; position:absolute; left:135px; top:14px; z-index:100500;"><img style="background:url(http://www.bostonterrierrescuecanada.com/wp-content/uploads/btrc_xmas_gift_30_sm.png); _background: none; _filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='http://cdn.swcdn.net/creative/v11.1/images/icons/icon-prod-hl-automatic-configuration-backup.png'); margin-left:0;" src="http://yorkmylove.ru/img/blank.gif" height="40" width="40"></div>
		<div id="dot2" style="width:40px; height:40px; position:absolute; left:135px; top:14px; z-index:100500;"><img style="background:url(http://www.retrospace.co.nz/assets/resized/sm/upload/s5/e0/od/vt/KURDW4134-Doctor-Who-Disc-Shape-Glass-Ornament_3-0-50-0-50.png?k=29d7695543); _background: none; _filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='http://cdn.swcdn.net/creative/v11.1/images/icons/icon-prod-hl-automatic-configuration-backup.png'); margin-left:44px;" src="http://yorkmylove.ru/img/blank.gif" height="50" width="37"></div>
		<div id="dot3" style="width:33px; height:49px; position:absolute; left:135px; top:14px; z-index:100500;"><img style="background:url(http://christmasinohio.com/silver-christmas-tree/blueround.png); _background: none; _filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='http://cdn.swcdn.net/creative/v11.1/images/icons/icon-prod-hl-automatic-configuration-backup.png');margin-left:0;margin-top:10px;" src="http://yorkmylove.ru/img/blank.gif" height="49" width="33"></div>
		<div id="dot4" style="width:47px; height:47px; position:absolute; left:135px; top:14px; z-index:100500;"><img style="background:url(http://www.bostonterrierrescuecanada.com/wp-content/uploads/btrc_xmas_gift_20_sm.png); _background: none; _filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='http://cdn.swcdn.net/creative/v11.1/images/icons/icon-prod-hl-automatic-configuration-backup.png');margin-left:40px;margin-top:20px;" src="http://yorkmylove.ru/img/blank.gif" height="40" width="40"></div>
		<img style="position: absolute;
width: 100px;
-webkit-user-select: none;
cursor: default;
left: -275px;
top: -40px;" src="http://lucky-lot.com.ua/cdn/page/content/logo_mini.png"/>
<img style="position: absolute;
width: 325px;
-webkit-user-select: none;
cursor: default;
left: 500px;
top: -20px;
pointer-events: none;" src="http://lucky-lot.com.ua/cdn/page/content/logo_title.png"/>
		<!--h1 style="position: absolute;
left: 275px;
top: 0px;
font-size: 62px;">Lucky Lot</h1-->
		<div class='userName' style='text-align:right; display:none;display: inline-block;
position: absolute;
right: 30px;
top: 10px;
}'></div>
		<center style="margin-top:100px;"  class="center">
			
			<div id="menu" />
		
		</center>
		<center>
		<div id="content" class="none" style="min-height: 600px;min-width: 800px;display:inline-block"> 
			<div id="left_content" class="none" > 
				###
			</div>
			<div id="body_box" class="none" > 
				###
			</div>
			<div id="body_info" class="text_content">
			<table>
				<tr>
					<td><span id="login_button" onclick="VK.Auth.login(authInfo);"></span></td>
					<td><span id="vk_like"></span></td>
				</tr>
			</table>
				
			</div>
		</div>
		</center>
		<div id="footer" class="none">
		
			<!--LiveInternet counter-->
			<script type="text/javascript">
			<!--
document.write("<a href='http://www.liveinternet.ru/click' "+
"target=_blank><img src='//counter.yadro.ru/hit?t27.1;r"+
escape(top.document.referrer)+((typeof(screen)=="undefined")?"":
";s"+screen.width+"*"+screen.height+"*"+(screen.colorDepth?
screen.colorDepth:screen.pixelDepth))+";u"+escape(document.URL)+
";"+Math.random()+
"' alt='' title='LiveInternet: показано количество просмотров и"+
" посетителей' "+
"border='0' width='88' height='120'><\/a>")
//-->
		</script>
		<!--/LiveInternet-->

		</div>
		
	</body>
</html>
